<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>植物模糊检系统</title>
<!--#include virtual="users.inc.asp"-->
<style type="text/css">
div#main>dl>dd>img {
	max-width: 300px;
	max-height: 225px;
} /* for firefox & ie7 */
div#main>dl>dd>img { /* for ie6 */
	width: expression(this.width > 300 && this.width > this.height ? 300 : auto);
	height: expression(this.height > 225 ? 225 : auto);
}

div#warp div#main {
	width:600px;
}
div#warp div#main dl {
	width:590px;
	margin:5px;
}
div#warp div#main dl dt {
	background-image:url(images/label-top.gif);
	height:40px;
	padding:5px;
	padding-left:40px;
	font-size:18px;
	font-weight:bold;
}
div#warp div#main dl dd {
	margin:0px;
	border-top-style: none;
	border-right-style: solid;
	border-bottom-style: none;
	border-left-style: solid;
	border-top-color: #9C6;
	border-right-color: #9C6;
	border-bottom-color: #9C6;
	border-left-color: #9C6;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	background-image: url(images/label-bottom.gif);
	background-repeat: no-repeat;
	background-position: bottom;
	padding:15px;
	min-height:225px;
}
div#warp div#main dl dd label {
	font-weight:bold;
}
div#warp div#main dl dd img {
	float:right;
}

div#left {
	width:400px;
	min-height:500px;
	float:left;
}

ul {
	margin:0px;
	padding:0px;
	display:block;
	clear:both;
}
li {
	list-style-type:none;
	display:block;
	float:left;
	width:100px;
	text-align:center;
}
li img {
	cursor:pointer;
}
</style>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('dl dt').toggle(function() {
		$(this).next().hide('slow');
	}, function() {
		$(this).next().show('slow');
	});	
});
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="banner"><a href="/"><img src="images/banner.jpg" /></a>
</div>
<div id="warp">
	<div id="left">
		<form action="prosearch.asp" method="get">
			<label for="ChineseName">中文名：</label>
			<input type="text" name="ChineseName" id="ChineseName" /><br />
			<label for="ScientificName">学名：</label>
			<input type="text" name="ScientificName" id="ScientificName" /><br />
			<label for="CommonName">俗名：</label>
			<input type="text" name="CommonName" id="CommonName" /><br />
			<input name="submit" type="submit" value="搜索" />
		</form>
	</div>
	
	<div id="main">
	<%
	query=" WHERE isDel=False"
		if request.QueryString("ChineseName")<>"" then
			query=query & " AND ChineseName LIKE '%" & request.QueryString("ChineseName") & "%'"
		end if
		if request.QueryString("ScientificName")<>"" then
			query=query & " AND ScientificName LIKE '%" & request.QueryString("ScientificName") & "%'"
		end if
		if request.QueryString("CommonName")<>"" then
			query=query & " AND CommonName LIKE '%" & request.QueryString("CommonName") & "%'"
		end if
	set conn=server.createobject("adodb.connection")
	conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("App_Data\MainDB.mdb")
	set rs=server.createobject("adodb.recordset")
	rs.open "SELECT * FROM [Species]" & query & " ORDER BY ChineseName ASC",conn,1,3
	if rs.eof then
		response.Write("<img src=""images/plant.gif"" width=""200"" height=""200"" alt=""Sorry"" /><span style=""font-size:24px"">抱歉，没有搜到植物，请后退查证检索条件，或者联系我们添加。</span>")
	else
 pSize = 12
 If request.QueryString("p") = "" Then
  pNum = 1
 Else
  pNum = Cint(request.QueryString("p"))
 End If
 rs.pagesize = pSize
 pCount = rs.pagecount
 rs.absolutepage = pNum
 flag = pSize
 Do while not rs.eof and flag > 0
 	flag = flag - 1
	%>
	<dl>
		<dt><%=rs("ChineseName") %></dt>
		<dd>
		<img src="<%
			if isNULL(rs("filepath")) then
				response.Write("images/unknown.jpg")
			else
				response.Write(rs("filepath"))
			end if
		%>" />
		<label>中文名：</label><%=rs("ChineseName") %><br />
		<label>学名：</label><span style="font-style:italic;"><%
			str=rs("ScientificName")
			pos=InStr(str," ")
			pos=pos+InStr(mid(str,pos+1,len(str))," ")
			if pos=0 or pos=instr(str," ") then
				pos=len(str)
			end if
			response.Write(left(str,pos-1))
		%></span><%=" " & mid(str,pos+1,len(str))%><br />
		<label>俗名：</label><%=rs("CommonName") %><br />
		<label>专业简介：</label><%
			popintro=rs("SciIntro")
			popintro=Replace(Replace(popintro, vbCrlf, "<br />"), chr(32)&chr(32), "<br />")
			response.Write(popintro)
		%><br />
		<a href="addpic.asp?id=<%=rs("SpeciesID") %>">添加图片</a><br />
		<a href="show.asp?id=<%=rs("SpeciesID") %>">详细信息</a><br />
		<a href="update.asp?id=<%=rs("SpeciesID") %>">修改信息</a><br />
		<a href="delspecies.asp?id=<%=rs("SpeciesID") %>">删除该种</a>
		</dd>
	</dl>
	<%
 	rs.movenext
 Loop
 response.Write("页码： - ")
 For k = 1 to pCount
  If k = pNum then
   response.Write(k & " - ")
  Else
   response.Write("<a href='prosearch.asp?" & query & "&p=" & k & "'>" & k & "</a> - ")
  End If
 Next
	end if
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	%>
	</div>
</div>
<div id="footer">
	<ul id="about">
		<li><a href="project.html">项目简介</a></li>
		<li><a href="aboutus.html">关于我们</a></li>
		<li><a href="contact.html">联系我们</a></li>
		<li><a href="addspecies.html">上传资料</a></li>
		<li><a href="login.asp">登陆</a></li>
		<li><a href="reg.asp">注册</a></li>
	</ul>
	<span id="copyright">Copyright © FRS,Darwin Association</span>
</div>
</body>
</html>
